<?php
namespace Qcloud\Sms\Demo;
require_once "SmsSender.php";
use Qcloud\Sms\SmsSingleSender;

try {
    // 请根据实际 appid 和 appkey 进行开发，以下只作为演示 sdk 使用
    // appid,appkey,templId申请方式可参考接入指南 https://www.qcloud.com/document/product/382/3785#5-.E7.9F.AD.E4.BF.A1.E5.86.85.E5.AE.B9.E9.85.8D.E7.BD.AE
    $appid = 1400046086;
    $appkey = "325b08e74da2ae8152bb5191e4d4a3f3";
    $phoneNumber = "13693716131";
    $templId = 50354;
    $singleSender = new SmsSingleSender($appid, $appkey);
    // 指定模板单发
    // 假设模板内容为：测试短信，{1}，{2}，{3}，上学。
    $params = array("12345");
    $result = $singleSender->sendWithParam("86", $phoneNumber, $templId, $params, "", "", "");
    $rsp = json_decode($result);
    echo $result;
    echo "<br>";



} catch (\Exception $e) {
    echo var_dump($e);
}
